package bz.ziro.kanbe.controller.mng.comment;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;
import org.slim3.datastore.Datastore;

import bz.ziro.kanbe.dao.CommentDao;
import bz.ziro.kanbe.model.Comment;

public class ApprovalController extends Controller {

    @Override
    public Navigation run() {
    	String keyBuf = requestScope("commentKey");
    	Comment comment = CommentDao.find(Long.valueOf(keyBuf));
    	//承認フラグを逆にする
    	comment.setFlag(!comment.isFlag());
    	Datastore.put(comment);
    	return null;
    }
}
